package santiago.view;

import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JFrame;
import santiago.client.Client;

public abstract class SantiagoFrame extends JFrame implements ISantiagoFrame {

    protected SantiagoFrame() {
        addWindowListener(new WindowAdapter() {
            @Override
            public void windowClosing(WindowEvent e) {
                Client.disconnect();
                System.exit(0);
            }
        });
    }

    @Override
    public final void printIt() {
        setVisible(true);
    }

    @Override
    public final void hideIt() {
        setVisible(false);
        dispose();
    }

    @Override
    public abstract void refresh();
}
